package com.yjf.repository;

import com.yjf.pojo.UserInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author Administrator 岳剑飞
 * @date
 * @description:
 */
public interface UserInfoRepository extends JpaRepository<UserInfo,Long> {
    @Query(value = "select * from user_info  where email=?1",nativeQuery = true)
    UserInfo findByEmail(String email);


    /**
     * 使用原生sql语句查询，需要将nativeQuery属性设置为true，默认为false（jpql）
     * @param name
     * @param address
     * @return
     */
    @Query(value = "select * from tb_resume  where name like ?1 and address like ?2",nativeQuery = true)
     List<UserInfo> findBySql(String name, String address);


}
